﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的订单 - {config.webname}</title>
<meta content="{config.webkeyword}" name="keywords" />
<meta content="{config.webdescription}" name="description" />
<link rel="stylesheet" href="{config.webpath}css/pagination.css" />
<link media="screen" type="text/css" href="<%templateskin%>/css/user.css" rel="stylesheet" />
  <!--css-->
<%template src="cssjs.html"%>
<!--/css-->

<script type="text/javascript" src="<%templateskin%>/js/base.js"></script>
</head>

<body>
<div class="wrapper">
 <!--Header-->
<%template src="_header.html"%>
<!--/Header-->
<div id="page_modules">

<div class="boxwrap" >
<div class="left_con_m">
        <div class="tile_left_m">
          <div class="tile_zh">JuiceUp 欢迎您！</div>
          <div class="tile_en"><em class="black">MY</em><em class="darkGreen">JUICEUP</em></div>
        </div>
        
      </div>
      <div  style=" padding-top:100px;">
  <div class="left180">
    <!--Sidebar-->
    <%template src="_ucenter_nav.html"%>
    <!--/Sidebar-->
  </div>
  
  <div class="right757">
   <%if {action}=="list"%>
    <h1 class="main_tit">
      <span><a href="<%linkurl("usercenter","index")%>">管理首页</a></span>
      My Order
      <strong>Order</strong>
    </h1>
   
    <!--交易订单-->
    <div class="tab_head">
      <ul class="tabs">
        <li class="selected"><a href="<%linkurl("userorder","list")%>">My Order</a></li>
       <!-- <li><a href="<%linkurl("userorder","close")%>">已关闭订单</a></li>-->
      </ul>
    </div>
    
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ftable">
      <tr>
        <th width="15%" align="left">Order ID</th>
        <th align="left">Product</th>
        <th width="10%">Person(s)</th>
        <th width="12%">Amount</th>
        <th width="16%">Order Time</th>
        <th width="10%">Order Status</th>
        <th width="12%"></th>
      </tr>
      <%set DataTable list1=get_order_list(10, page, "user_id='"+userModel.id+"'  and mobile not in('1','2') and status<=3", out totalcount)%> <!--取得一个DataTable-->
      <%set string pagelist1=get_page_link(10, page, totalcount, "userorder", action, "__id__")%> <!--取得分页页码列表-->
        <%set int t__loop__id=0;%>
      <%foreach(DataRow dr in list1.Rows)%>
      <tr>
        <td>{dr[order_no]}</td>
        <td>
         <%set List<ihongma.Model.article> ls=get_order_goods_list({strtoint({dr[id]})})%>
          <%set (string)name=""%>
          <%if(ls!=null)%>
           <%csharp%>t__loop__id=0;<%/csharp%>
          <%foreach(ihongma.Model.article modelt in ls)%>
        
          
                                 <%csharp%>name={modelt.title};<%/csharp%>
                                 <%csharp%>t__loop__id++;<%/csharp%>
                              
          <%/foreach%>
          <%/if%>
         
            <%csharp%>name=Utils.SubString(name,6); <%/csharp%>{name}
            <%if({dr[mobile]}!="1") %>
            {t__loop__id}天清体计划
            <%/if%>
        </td>
        <td align="center"> <%if({dr[mobile]}!="1") %>{dr[post_code]}人订购<%else%>    <%csharp%> int quantity=new ihongma.BLL.orders().GetModel(dr["order_no"].ToString()).order_goods[0].quantity;<%/csharp%>{quantity}张<%/if%></td>
        <td align="center"><strong>￥{dr[order_amount]}</strong><br /><%=get_payment_title({strtoint({dr[payment_id]})})%></td>
        <td align="center">{dr[add_time]}</td>
        <td align="center">
         <%if(get_order_payment_status({strtoint({dr[id]})}))%>
          <a href="<%linkurl("payment","confirm",{dr[order_no]})%>" style="color:#e4007f;">Go to the payment</a> 
          <%else%>
          <%=get_order_status({strtoint({dr[id]})})%>
          <%/if%>
        </td>
        <td align="center">
          <a href="<%linkurl("userorder_show",{dr[id]})%>" style="color:#e4007f;">View Order</a><br />
         
          <%if({strtoint({dr[status]})}<2)%>
        <!--  <a href="javascript:;" onclick="clickSubmit('{config.webpath}tools/submit_ajax.ashx?action=order_cancel&order_no={dr[order_no]}');">取消</a>-->
          <%/if%>
        </td>
      </tr>
      <%/foreach%>
      <%if(totalcount<1)%>
      <tr><td colspan="8" align="center">暂无记录</td></tr>
      <%/if%>
    </table>
    
    <div class="page_foot">
      <div class="flickr right"></div><!--放置页码列表-->
    </div>
    <!--交易订单-->
    
    <%else if(action=="list1")%>
      <h1 class="main_tit">
      <span><a href="<%linkurl("usercenter","index")%>">管理首页</a></span>
      我的礼品卡
      <strong>Order</strong>
    </h1>
     <!--交易订单-->
    <div class="tab_head">
      <ul class="tabs">
        <li class="selected"><a href="<%linkurl("userorder","list1")%>">我的礼品卡</a></li>
       <!-- <li><a href="<%linkurl("userorder","close")%>">已关闭订单</a></li>-->
      </ul>
    </div>
    
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ftable">
      <tr>
        <th width="15%" >订单号</th>
        <th >订单商品</th>
        <th width="10%">数量</th>
        <th width="12%">订单金额</th>
        <th width="16%">下单时间</th>
        <th width="10%">订单状态</th>
        <th width="12%"></th>
      </tr>
      <%set DataTable list1=get_order_list(10, page, "user_id='"+userModel.id+"' and mobile='1' and status<=3", out totalcount)%> <!--取得一个DataTable-->
      <%set string pagelist1=get_page_link(10, page, totalcount, "userorder", action, "__id__")%> <!--取得分页页码列表-->
        <%set int t__loop__id=0;%>
      <%foreach(DataRow dr in list1.Rows)%>
      <tr>
        <td>{dr[order_no]}</td>
        <td>
          <%csharp%> List<ihongma.Model.order_goods> quantity=new ihongma.BLL.orders().GetModel(dr["order_no"].ToString()).order_goods;<%/csharp%>
         
          
         
         
         <%foreach(ihongma.Model.order_goods L in quantity)%>
        
          
                                {L.goods_title}<br />
                              
          <%/foreach%>
         
         
          
            
        </td>
        <td align="center">   
      
        
          <%foreach(ihongma.Model.order_goods L in quantity)%>
        {L.quantity}张<br />
         <%/foreach%>
        </td>
        <td align="center"><strong>￥{dr[order_amount]}</strong><br /><%=get_payment_title({strtoint({dr[payment_id]})})%></td>
        <td align="center">{dr[add_time]}</td>
        <td align="center">
         <%if(get_order_payment_status({strtoint({dr[id]})}))%>
          <a href="<%linkurl("payment","confirm",{dr[order_no]})%>" style="color:#e4007f;">去付款</a> 
          <%else%>
          <%=get_order_status({strtoint({dr[id]})})%>
          <%/if%>
        </td>
        <td align="center">
          <a href="<%linkurl("userorder_show",{dr[id]})%>" style="color:#e4007f;">查看订单</a><br />
         
          <%if({strtoint({dr[status]})}<2)%>
        <!--  <a href="javascript:;" onclick="clickSubmit('{config.webpath}tools/submit_ajax.ashx?action=order_cancel&order_no={dr[order_no]}');">取消</a>-->
          <%/if%>
        </td>
      </tr>
      <%/foreach%>
      <%if(totalcount<1)%>
      <tr><td colspan="8" align="center">暂无记录</td></tr>
      <%/if%>
    </table>
    
    <div class="page_foot">
      <div class="flickr right"></div><!--放置页码列表-->
    </div>
    <!--交易订单-->
    <%else if(action=="list2")%>
      <h1 class="main_tit">
      <span><a href="<%linkurl("usercenter","index")%>">管理首页</a></span>
    我的疗程卡  
      <strong>Order</strong>
    </h1>
     <%set DataTable list1=get_order_list(10, page, "user_id='"+userModel.id+"' and payment_status=1 and mobile='2' and status<=3", out totalcount)%> <!--取得一个DataTable-->
      <%set string pagelist1=get_page_link(10, page, totalcount, "userorder", action, "__id__")%> <!--取得分页页码列表-->
      <%if(list1.Rows.Count>0)%>
     <!--交易订单-->
    <div class="tab_head">
      <ul class="tabs">
        <li class="selected"><a href="<%linkurl("userorder","list2")%>">未支付疗程卡</a></li>
       <!-- <li><a href="<%linkurl("userorder","close")%>">已关闭订单</a></li>-->
      </ul>
    </div>
        
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ftable">
      <tr>
        <th width="15%" >订单号</th>
        <th >订单商品</th>
        <th width="10%">数量</th>
        <th width="12%">订单金额</th>
        <th width="16%">下单时间</th>
        <th width="10%">订单状态</th>
        <th width="12%"></th>
      </tr>
 
        
      <%foreach(DataRow dr in list1.Rows)%>
      <tr>
        <td>{dr[order_no]}</td>
        <td>
          <%csharp%> List<ihongma.Model.order_goods> quantity=new ihongma.BLL.orders().GetModel(dr["order_no"].ToString()).order_goods;<%/csharp%>
         
          
         
         
         <%foreach(ihongma.Model.order_goods L in quantity)%>
        
          
                                {L.goods_title}<br />
                              
          <%/foreach%>
         
         
          
            
        </td>
        <td align="center">   
      
        
          <%foreach(ihongma.Model.order_goods L in quantity)%>
        {L.quantity}张<br />
         <%/foreach%>
        </td>
        <td align="center"><strong>￥{dr[order_amount]}</strong><br /><%=get_payment_title({strtoint({dr[payment_id]})})%></td>
        <td align="center">{dr[add_time]}</td>
        <td align="center">
         <%if(get_order_payment_status({strtoint({dr[id]})}))%>
          <a href="<%linkurl("payment","confirm",{dr[order_no]})%>" style="color:#e4007f;">去付款</a> 
          <%else%>
          <%=get_order_status({strtoint({dr[id]})})%>
          <%/if%>
        </td>
        <td align="center">
          <!--<a href="<%linkurl("userorder_show",{dr[id]})%>" style="color:#e4007f;">查看订单</a><br />-->
         
          <%if({strtoint({dr[status]})}<2)%>
        <!--  <a href="javascript:;" onclick="clickSubmit('{config.webpath}tools/submit_ajax.ashx?action=order_cancel&order_no={dr[order_no]}');">取消</a>-->
          <%/if%>
        </td>
      </tr>
      <%/foreach%>
      <%if(totalcount<1)%>
      <tr><td colspan="8" align="center">暂无记录</td></tr>
      <%/if%>
    </table>
    
    <div class="page_foot">
      <div class="flickr right"></div><!--放置页码列表-->
    </div>
    <%/if%>
     <div class="tab_head">
      <ul class="tabs">
        <li class="selected"><a href="<%linkurl("userorder","list2")%>">我的疗程卡</a></li>
       <!-- <li><a href="<%linkurl("userorder","close")%>">已关闭订单</a></li>-->
      </ul>
    </div>
    <script type="text/javascript" src="{config.webpath}scripts/jquery/jquery.form.min.js"></script>
    <script type="text/javascript" src="{config.webpath}scripts/jquery/Validform_v5.3.2_min.js"></script>
        <script type="text/javascript">
            $(function () {
                //初始化表单
                AjaxInitForm('point_form', 'btnSubmit', 1, 'turl');
            });
    </script>
     
    <form id="point_form" name="point_form" url="{config.webpath}tools/submit_ajax.ashx?action=liaocheng">
    <div class="form_box">
      <!--<dl>
        <dt>兑换说明：</dt>
        <dd>积分兑换最少金额为1元，兑换比例为：1元等于{uconfig.pointcashrate}个积分</dd>
      </dl>-->
      <dl>
        <dt  style="width:80px">疗程卡卡号：</dt>
        <dd style="margin-left: 0px;"><input name="SN" id="SN" type="text" class="input small"  nullmsg="请疗程卡卡号" sucmsg=" " /><input name="btnSubmit" id="Submit1" type="submit" class="" value="确认添加" />
       </dd>
     </dl>
     
    </div>
    </form>
    <input id="turl" name="turl" type="hidden" value="<%linkurl("userorder","list2")%>" /> 
 <table width="100%" border="0" cellspacing="0" cellpadding="0" style="text-align:center" class="ftable">
      <tr>
        <th width="10%" >id</th>
        <th  width="10%">疗程卡类别</th>
        <th width="10%">剩余次数</th>
        <th width="19%">添加时间</th>
        <th width="20%">到期时间</th>
        <th width="10%">订单状态</th>
     
      </tr>
  <%set DataTable list2=get_liaocheng_list(userModel.id)%> <!--取得一个DataTable-->
        <%set int t__loop__id=0;%>
      <%foreach(DataRow dr in list2.Rows)%>
      <tr>
        <td>{dr[id]}</td>
        <td>
          
         {dr[field]}
         
          
            
        </td>
        <td align="center">   
      
        
         {dr[number]}
        </td>
       
        <td align="center">{dr[addtiem]}</td>
        <td align="center">
         <%if({strtoint({dr[state]})}==1)%>
       ----
          <%else%>
           {dr[endtime]}
          <%/if%>
        </td>
        <td align="center">
          <a href="<%linkurl("goods")%>?type=1" style="color:#e4007f;">立即使用</a><br />
         
     
        </td>
      </tr>
      <%/foreach%>
     
    </table>
    
    <div class="page_foot">
      <div class="flickr right"></div><!--放置页码列表-->
    </div>
    <%/if%>
  </div>
  </div>
</div>

<div class="clear"></div>
</div>
<!--Footer-->
<%template src="_footer.html"%>
<!--/Footer-->
